
interface TextTransformMap {
  [key: string]: string;
};

const authorityMap: TextTransformMap = {
  'admin': 'Administrator',
  'user': 'User'
};

const transformAuthority = (raw: string | undefined): string => {
  let result: string = '';
  if (raw !== undefined && raw in authorityMap) {
    result = authorityMap[raw];
  }
  return result;
};

const analyzeResultMap: TextTransformMap = {
  'good': 'Good',
  'bad': 'Bad'
};

const transformAnalyzeResult = (raw: string | undefined): string => {
  let result: string = '';
  if (raw !== undefined && raw in analyzeResultMap) {
    result = analyzeResultMap[raw];
  }
  return result;
};

export const defaultAuthority = 'user';

export { transformAuthority, transformAnalyzeResult };